#include "global.h"
using namespace std;

void generator_rectangle (Point & x, Point & y, int num, vector<Point> & seeds)
{
	//The diagonal of rectangle is (x) and (y)
	DOUBLE x1 = std::min (x.x(), y.x());
	DOUBLE x2 = std::max (x.x(), y.x());
	DOUBLE y1 = std::min (x.y(), y.y());
	DOUBLE y2 = std::max (x.y(), y.y());
	DOUBLE offset_x = x2 - x1;
	DOUBLE offset_y = y2 - y1;
	
	for (int i = 0; i < num; ++i)
	{
		DOUBLE x = rand () % 65536 ; 
		DOUBLE y = rand () % 65536;
		
		x =  x / 65535.0 + x1;
		y =  y / 65535.0 + y1;
		x*= offset_x;
		y*= offset_y;
		//cout<<x<<','<<y<<',';
		seeds.push_back(Point (x, y));
	}
	
	
}

int main(int argc, char ** argv)
{
	/*
	if (argc <=1)
	{
		cerr<<"Usage: "<<argv[0]<< " config file name"<<endl;
	}
	*/
//	ifstream ifs(cin);
	//First read the boundary of C Voronoi Diagram
	/*
	int numofedge;
	cin >> numofedge;
	Polygon bound;
	for (int i = 0; i < numofedge; ++i)
	{
		Point p;
		cin>> p;
		bound.push_back(p);
	}
	*/
	//Second, read the seeds.
	/*
	int numofseed;
	cin>>numofseed;
	vector<Point> seeds;
	for (int i = 0; i < numofseed; ++i)
	{
		cin>>p;
		seeds.push_back(p);
	}
	*/
	
	int numofseeds;
	int randseed;
	cin>> numofseeds;
	cin>>randseed;
	
	srand (randseed);
	
	Point x, y;
	cin>> x >>y;
	
	DOUBLE x1 = std::min (x.x(), y.x());
	DOUBLE x2 = std::max (x.x(), y.x());
	DOUBLE y1 = std::min (x.y(), y.y());
	DOUBLE y2 = std::max (x.y(), y.y());
	//output the boundary
	
	cout<<4<<endl;
	cout<<x1<<' '<<y1<<endl;
	cout<<x2<<' '<<y1<<endl;
	
	cout<<x2<<' '<<y2<<endl;
	cout<<x1<<' '<<y2<<endl;
		
	vector<Point> seeds;
	generator_rectangle(x,y, numofseeds, seeds);
	cout<<numofseeds<<endl;
	for (int i = 0; i< numofseeds; ++i)
	{
		cout<<seeds[i]<<endl;
		//cout<<seeds[i].x()<<','<<seeds[i].y()<<','; 
	}
	cout<<endl;
	
	
	
	return 0;	
}
